﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Windows.Input;
using System.Windows.Forms;
using myWindowsMediaPlayer.Model;

namespace myWindowsMediaPlayer.ViewModel
{
    class menuViewModel : viewModelBase
    {
        private ICommand addMovieCommand;
        private ICommand addMusicCommand;
        private ICommand addPictureCommand;

        public ICommand AddMovieCommand
        {
            get
            {
                if (this.addMovieCommand == null)
                    addMovieCommand = new relayCommand(() => this.AddMovieDirectory());
                return addMovieCommand;
            }
        }

        public ICommand AddMusicCommand
        {
            get
            {
                if (this.addMusicCommand == null)
                    addMusicCommand = new relayCommand(() => this.AddMusicDirectory());
                return addMusicCommand;
            }
        }

        public ICommand AddPictureCommand
        {
            get
            {
                if (this.addPictureCommand == null)
                    this.addPictureCommand = new relayCommand(() => this.AddPictureDirectory());
                return addPictureCommand;
            }
        }

        private void AddMusicDirectory()
        {
            FolderBrowserDialog folder = new FolderBrowserDialog();
            myConfigManager conf = new myConfigManager();

            folder.ShowNewFolderButton = false;
            folder.ShowDialog();
            conf.MusicPath = folder.SelectedPath;
        }

        private void AddMovieDirectory()
        {
            FolderBrowserDialog folder = new FolderBrowserDialog();
            myConfigManager conf = new myConfigManager();

            folder.ShowNewFolderButton = false;
            folder.ShowDialog();
            conf.MoviePath = folder.SelectedPath;
        }

        private void AddPictureDirectory()
        {
            FolderBrowserDialog folder = new FolderBrowserDialog();
            myConfigManager conf = new myConfigManager();

            folder.ShowNewFolderButton = false;
            folder.ShowDialog();
            conf.PicturePath = folder.SelectedPath;

        }
    }
}
